<?php
/* @var $this EvaluacionController */
/* @var $model Evaluacion */
/* @var $form CActiveForm */
?>

<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'evaluacion-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // There is a call to performAjaxValidation() commented in generated controller code.
        // See class documentation of CActiveForm for details on this.
        'enableAjaxValidation' => false,
    ));
    ?>

    <p class="note">Campos con <span class="required">*</span> son requeridos.</p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'colegios_idColegios'); ?>
        <?php echo $form->dropDownList($model, 'colegios_idColegios', CHtml::listData(Colegios::model()->findAll(), 'idColegios', 'nombreColegio'));
        ?>
        <?php echo $form->error($model, 'colegios_idColegios'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'curso_idCurso'); ?>
        <?php echo $form->dropDownList($model, 'curso_idCurso', CHtml::listData(Curso::model()->findAll(), 'idCurso', 'nombreCurso'));
        ?>
        <?php echo $form->error($model, 'curso_idCurso'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'modalidad'); ?>
        <?php echo $form->textField($model, 'modalidad', array('size' => 20, 'maxlength' => 20)); ?>
        <?php echo $form->error($model, 'modalidad'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'fecha'); ?>
        <?php
        date_default_timezone_set('America/Lima');
        if ($model->fecha != '') {
            $model->fecha = date('yy-mm-dd', strtotime($model->fecha));
        }
        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model' => $model,
            'attribute' => 'fecha',
            'value' => $model->fecha,
            'language' => 'es',
            'options' => array(
                'defaultDate' => $model->fecha,
                'dateFormat' => 'yy-mm-dd',
                'constraintInput' => 'false',
                'duration' => 'fast',
            ),
        ));
        ?>
        <?php echo $form->error($model, 'fecha'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'horaInicio'); ?>
        <?php
        echo $form->hiddenField($model, 'horaInicio');
        $this->widget('application.extensions.etimepicker.ETimePicker', array('altField' => 'Evaluacion_horaInicio'));
        echo $form->error($model, 'horaInicio');
        ?>
        <?php echo $form->error($model, 'horaInicio'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'horaFin'); ?>
        <?php
        //echo $form->textField($model, 'horaFin'); 
        echo $form->hiddenField($model, 'horaFin');
        $this->widget('application.extensions.etimepicker.ETimePicker', array('altField' => 'Evaluacion_horaFin'));
        echo $form->error($model, 'horaFin');
        ?>
        <?php echo $form->error($model, 'horaFin'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'nivel'); ?>
        <?php echo $form->dropDownList($model, 'nivel', array("Primaria" => "Primaria", "Secundaria" => "Secundaria"), array('empty' => 'Seleccione un nivel')); ?>
        <?php echo $form->error($model, 'nivel'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'grado'); ?>
        <?php echo $form->textField($model, 'grado', array('size' => 3)); ?>
        <?php echo $form->error($model, 'grado'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'seccion'); ?>
        <?php echo $form->textField($model, 'seccion', array('size' => 3)); ?>
        <?php echo $form->error($model, 'seccion'); ?>
    </div>

    <div class="row">
        <?php //echo $form->labelEx($model, 'estado');  ?>
        <?php //echo $form->textField($model, 'estado', array('size' => 1, 'maxlength' => 1)); ?>
        <?php //echo $form->error($model, 'estado'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'observacion'); ?>
        <?php echo $form->textArea($model, 'observacion', array('maxlength' => 100)); ?>
        <?php echo $form->error($model, 'observacion'); ?>
    </div>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Save'); ?>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->

<style>
    .row {
        margin-left: 0px;
    }
    .hour, .minute{
        width: inherit;
    }
    .etimepicker select{
        width: inherit;   
    }

    input, textarea, .uneditable-input {
        width: 180px;
    }
    select {
        width: 180px;
    }
</style>